<template>
  <div class="pages" style="height: 58px;">
    <div class="log">
<!--      <el-image :src="log" style="width: 525px;height: 62px;margin-left: 30px"/>-->
      <el-image :src="log" style="width: 435px;height: 57px;margin-left: 35px"/>
    </div>
    <div class="center">
      <div class="tq">
        <el-image :src="tq" style="width: 44px;height: 44px;margin-right: 10px"/>
        <span style="font-weight: bold">24-32°C</span>
        <span>多云</span>
        <span>西北风3级</span>
      </div>
      <span>admin<i class="el-icon-arrow-down"/></span>
      <span><i class="el-icon-setting"/> 调度设置</span>
      <span @click="handleLogout"> <i class="el-icon-switch-button"/>退出</span>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      log: require("@/assets/images/wpwork1.png"),
      tq: require("@/assets/subDiv/tianqi/多云.svg"),
    }
  },
  methods: {
    handleLogout() {
      this.$confirm('您确定要退出应用程序吗?', '提示', {
        type: 'warning'
      }).then(() => {
        this.logout();
      }).catch(() => { });
    },
    async logout() {
      await this.$store.dispatch('user/logout')
      // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
      this.$router.push(`/login`)
    },
  }
}
</script>
<style scoped lang="scss">
.pages {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  background-color: #1865F2;
  position: relative;
  width: 100%;
  padding-right: 10px;

  .log {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    flex-direction: column;
    align-self: center;
    justify-content: center;
    width: 620px;
    height: 69px;
    background-image: url("../../../assets/subDiv/logbj.svg");
    background-size: 100% 100%;
  }


  .center {
    color: #ffffff;
    display: flex;
    flex-direction: row;
    align-self: center;

    span {
      display: flex;
      flex-direction: row;
      align-items: center;
      margin-right: 30px;
      cursor: pointer;
    }

    .tq {
      display: flex;
      flex-direction: row;
      align-items: center;
      margin-right: 50px;

      span {
        margin-right: 10px;
      }
    }
  }
}
</style>
